package test;

import java.util.Scanner;

public class KeDaXunFei3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        System.out.println(getRes(num));
    }

    private static int getRes(int num) {
        if (num == 0){
            return 0;
        }
        int count = 0;
        while (num != 0){
            if ((num & 1) == 1){
                count ++;
            }
            num = num >>> 1;
        }
        return count;
    }
}
